package demo;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class DemoTest {
    public static void main(String[] args) {
        //实例化一个Spring容器,初始化
        AnnotationConfigApplicationContext applicationContext =
                new AnnotationConfigApplicationContext(Config.class);
        //获得Spring容器中保存的对象
        //get.Bean(对象的名称,对象的类型.class)
        Student stu =applicationContext.getBean("stu",Student.class);
        System.out.println(stu);

    }

}
